loginRegisterService.$inject = ['$http'];

function loginRegisterService($http) {
    var appContext = require('../../../config/app.context');
    var urlBase = appContext.path + '/api/customers';
    var _loginRegisterService = {};

    _loginRegisterService.doLogin = function(loginInfo) {
        return $http.get(urlBase + '/findByCustomerNameAndPwd/' + loginInfo.name + '/' + loginInfo.password);
    }

    _loginRegisterService.doRegister = function(regInfo) {
        return $http.post(urlBase, regInfo);
    }

    return _loginRegisterService;
}

module.exports = loginRegisterService;